package com.example.sbbsec.domain.constantenum;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Map;

import static com.google.common.collect.Lists.newArrayList;
import static com.google.common.collect.Maps.newHashMap;

/**
 * Created by lowe.yang on 8/04/2017.
 * 系统资源枚举类
 */
@AllArgsConstructor
@Getter
public enum ResourceEnum {
    //系统管理
    ROLE_MANAGE(3L, "角色管理"),
    ACCOUNT_MANAGE(4L, "用户管理"),
    LOGGING_MANAGE(13L, "日志管理"),
    MENU_MANAGE(14L, "菜单管理");

    private Long id;

    private String name;


    public static Map<Long, String> getAllValue() {
        final Map<Long, String> result = newHashMap();

        final ResourceEnum[] resources = ResourceEnum.values();
        newArrayList(resources).forEach(resource -> result.put(resource.getId(), resource.getName()));

        return result;
    }

}
